from torch.utils.tensorboard import SummaryWriter
from PIL import Image
import numpy as np
writer = SummaryWriter("log")
image_path = "dataset/train/ants/0013035.jpg"
img_PIL = Image.open(image_path)
print(type(img_PIL))
img_array = np.array(img_PIL)
print(type(img_array),img_array.shape)
writer.add_image("test",img_array,1,dataformats="HWC")
for i in range(100):
    writer.add_scalar("y=2x",3*i,i)
writer.close()
